package com.eleventwelve.iris.entity;

import java.util.List;

import javax.persistence.*;

import org.opentides.bean.BaseEntity;

/**
 * 
 * @author Ashley
 *
 */
@Entity
@Table(name="PRESCRIPTION")
public class Prescription extends BaseEntity{
	private static final long serialVersionUID = 9089902848842221842L;
	
	@OneToOne(mappedBy="prescription")
	private Treatment treatment;
	
	@Lob
	@Column(name="ADVICE")
	private String advice;

	@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL }, mappedBy = "prescription")
	private List<PrescribedMedicine> prescribedMedicines;
	
	@Transient
	private transient List<PrescribedMedicine> transientMedicines;
	
	public Treatment getTreatment() {
		return treatment;
	}

	public void setTreatment(Treatment treatment) {
		this.treatment = treatment;
	}

	public String getAdvice() {
		return advice;
	}

	public void setAdvice(String advice) {
		this.advice = advice;
	}

	public List<PrescribedMedicine> getPrescribedMedicines() {
		return prescribedMedicines;
	}

	public void setPrescribedMedicines(List<PrescribedMedicine> prescribedMedicines) {
		this.prescribedMedicines = prescribedMedicines;
	}

	public List<PrescribedMedicine> getTransientMedicines() {
		return transientMedicines;
	}

	public void setTransientMedicines(List<PrescribedMedicine> transientMedicines) {
		this.transientMedicines = transientMedicines;
	}
	

}
